from django.db import models


class User(models.Model):
    username = models.CharField(max_length=30)
    password = models.CharField(max_length=100)
    name = models.CharField(max_length=30, null=True)
    img = models.CharField(max_length=50, null=True)
    is_active = models.BooleanField(null=True)
    level = models.BooleanField(null=True)
    integral = models.IntegerField(null=True)
    invitation_code = models.CharField(max_length=30, null=True)


class DiSan(models.Model):
    A = ((1, '微博'), (2, 'QQ'), (3, '微信'))
    user_id = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    login_type = models.SmallIntegerField(choices=A, default=1)
    uid = models.CharField(max_length=90,default='')
